//报错，似乎只有前段才能用，测试失败

import { webSocket } from "rxjs/webSocket";
const subject = webSocket("ws://localhost:18081");

subject.subscribe(
   msg => console.log('message received: ' + msg), // Called whenever there is a message from the server.
   err => console.log(err), // Called if at any point WebSocket API signals some kind of error.
   () => console.log('complete') // Called when connection is closed (for whatever reason).
 );